﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace LastfmNet.Models
{
    public class Affiliations : LastfmModelBase
    {
        public Affiliations()
        {
            this.Physicals = new List<Affiliation>();
            this.Downloads = new List<Affiliation>();
        }

        public Affiliations(XmlNode affiliationsNode)
        {
            if (affiliationsNode == null) return;
            this.InitializeFromXmlNode(affiliationsNode);
        }

        public override void InitializeFromXmlNode(XmlNode node)
        {
            if (node == null) return;
            this.Physicals = LastfmModelBase.GetList<Affiliation>(node.GetChild("physicals"));
            this.Downloads = LastfmModelBase.GetList<Affiliation>(node.GetChild("downloads"));
        }

        public IList<Affiliation> Physicals
        {
            get;
            set;
        }

        public IList<Affiliation> Downloads
        {
            get;
            set;
        }
    }
}
